/**************************************************************************
 *                                                                        *
 *         Copyright (c) 2007 by Sunplus mMedia Inc.                      *
 *                                                                        *
 *  This software is copyrighted by and is the property of Sunplus        *
 *  mMedia Inc. All rights are reserved by Sunplus mMedia Inc.  This      *
 *  software may only be used in accordance with the corresponding        *
 *  license agreement. Any unauthorized use, duplication, distribution,   *
 *  or disclosure of this software is expressly forbidden.                *
 *                                                                        *
 *  This Copyright notice MUST not be removed or modified without prior   *
 *  written consent of Sunplus mMedia Inc.                                *
 *                                                                        *
 *  Sunplus mMedia Inc. reserves the right to modify this software        *
 *  without notice.                                                       *
 *                                                                        *
 *  Sunplus mMedia Inc.                                                   *
 *  19-1, Innovation First Road, Science-Based Industrial Park,           *
 *  Hsin-Chu, Taiwan, R.O.C.                                              *
 *                                                                        *
 **************************************************************************/

#ifndef __DOSFUNC_H__
#define __DOSFUNC_H__

#include "chipopt.h"
#include "cardopt.h"
#include "cardfunc.h"

//------------------------------------------------------------------------------
//Macro prototype
//------------------------------------------------------------------------------

#if ( K_File_HaveVideo )
#if ( K_File_PutVideoAtDram == 0 )
#define M_SrcAviFifo_ReadOldPage                SMC_Card2Sram
#define M_SrcAviFifo_WriteOldPage               SMC_Sram2Card
#define M_SrcAviFifo_WriteAviPage               M_Card_LPVideoFifo2Card
#else
#define M_SrcAviDram_ReadOldPage                SMC_Card2Sram                        
#define M_SrcAviDram_WriteOldPage               SMC_Sram2Card                       
#define M_SrcAviDram_WriteAviPage               M_Card_LPDram2Card
#endif

#define M_SrcAviFrameHead_WritePage		M_Card_LPSram2Card

#endif

#define M_SrcDataDram_ReadOldPage               SMC_Card2Sram
#define M_SrcDataDram_WriteOldPage              SMC_Sram2Card
#define M_SrcDataDram_WriteDataPage             M_Card_LPDram2Card

#if ( K_File_PutVideoAtDram == 0 && K_File_HaveAviInterlace)
#define M_SrcDataDramPort_WriteDataPage         M_Card_LPDram2CardByPort
#else
#define M_SrcDataDramPort_WriteDataPage         M_Card_LPDram2Card
#endif

//------------------------------------------------------------------------------
//Function prototype
//------------------------------------------------------------------------------

//-------------------------------------
//dosdir.c
//-------------------------------------
UINT8 DOS_FdbFilter(UINT8 *fdb, UINT8 matchCond, UINT32 refCon);

//-------------------------------------
//dosfile.c
//-------------------------------------
UINT8 File_DeleteLfnFdb(UINT32 fdbLogAddr); // @012403@wyeo@add delete long file name fdb

//-------------------------------------
//dosfat.c
//-------------------------------------
UINT16 DOS_OptimizedCluster(UINT32 sectorPerCard);
UINT8 DOS_CalMBS(void);
void DOS_FillMBS(void);
void DOS_InitPBSGlobal(void);
void DOS_ResetPBSGlobal(void);
void DOS_FillPBS(void);

//-------------------------------------
//dosdat.h
//-------------------------------------

//-------------------------------------
//dosdef.h
//-------------------------------------

//-------------------------------------
//dosrw.c
//-------------------------------------
UINT8 BlockDram2Card( UINT32 srcRamAddr, UINT32 dstStartLogAddr, UINT32 writeSize );
UINT8 BlockCard2Dram( UINT32 dstRamAddr, UINT32 dstStartLogAddr, UINT32 readSize );
UINT8 File_Flush(void);

#endif /*__DOSFUNC_H__*/

